package com.tvunetworks.center.device.mapper;

import com.tvunetworks.center.common.model.PreloadExtModel;
import com.tvunetworks.center.common.model.param.ReceiverDeleteExtParam;
import com.tvunetworks.center.device.model.ExternalReceiverRelation;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.additional.insert.InsertListMapper;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;
/**
 * @program: tvucc-aggregator
 * @author lebronchen
 * @create: 2019-11-05 14:45
 **/
public interface ExternalReceiverRelationMapper extends Mapper<ExternalReceiverRelation>, InsertListMapper<ExternalReceiverRelation> {
    /**
     *
     * @param peerId peerId
     * @return List
     */
    List<String> listExtBindedRids(@Param("peerId") String peerId);

    /**
     * 和 oldPeerId 有绑定关系，但是和 newPeerId 没有绑定关系的 fullIds
     * @param oldPeerId oldPeerId
     * @param newPeerId newPeerId
     * @return List
     */
    List<String> listFullIdsInPeerId1NotInPeerId2(@Param("oldPeerId") String oldPeerId, @Param("newPeerId") String newPeerId);

    /**
     *
     * @param rid rid
     * @return List
     */
    List<PreloadExtModel> listPreloadExtModelByRid(@Param("rid") String rid);

    /**
     *
     * @param rid rid
     * @return List
     */
    List<PreloadExtModel> listPreloadEventExtModelByRid(@Param("rid") String rid);

    /**
     *
     * @param param param
     * @return int
     */
    int receiverDeleteExt(ReceiverDeleteExtParam param);
}
